package com.loveprogrammer.lowercode.common;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.http.HttpStatus;

/**
 * @ClassName ReturnMessage
 * @Description 返回体
 * @Author admin
 * @Date 2024/5/31 16:18
 * @Version 1.0
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class ReturnMessage<T> {

    boolean success;

    T data;

    String msg;

    int code;

    public static <T> ReturnMessage ok(T t) {
        return new ReturnMessage(true,t,"success",HttpStatus.OK.value());
    }

}
